<script setup>
import { ref } from 'vue'
import useToken from '@/stores/token';
import { useRouter } from 'vue-router';
const router = useRouter() // 得到router实例
const isShow = ref(true)
const logout = () => {
    const { removeToken } = useToken()
    removeToken()
    router.push('/login') 
}
const changeshow = () => {
  isShow.value=false
}
</script>
<template>
  <div class="box" @click="changeshow">
    <el-dialog v-model="isShow" width="30%">
<h2 style="padding-left:100px;margin-bottom:30px">确定要退出吗？</h2>
<el-row type="flex" justify="center">
    <el-button @click="changeshow">取消</el-button>
    <el-button type="primary" @click="logout">确定</el-button>
</el-row>
  </el-dialog>
  </div>

</template>

<style scoped>
.box{
  width: 100%;
  height: 100%;
  background:url('../../../assets/logout.jpg') center;
}
</style>